﻿#region << 版 本 注 释 >>
/*----------------------------------------------------------------
* 项目名称 ：APP.Trading.Entity.Response
* 项目描述 ：
* 类 名 称 ：ProductDetailResponse
* 类 描 述 ：
* 所在的域 ：DESKTOP-07DQ4D0
* 命名空间 ：APP.Trading.Entity.Response
* 机器名称 ：DESKTOP-07DQ4D0 
* CLR 版本 ：4.0.30319.42000
* 作    者 ：Me.笨先生 (66623978)
* 创建时间 ：2018/2/7 9:17:24
* 更新时间 ：2018/2/7 9:17:24
* 版 本 号 ：v1.0.0.0
*******************************************************************
* Copyright @ admin 2018. All rights reserved.
*******************************************************************
//----------------------------------------------------------------*/
#endregion

using System;

namespace APP.Trading.Entity.Response
{
    /// <summary>
    /// 
    /// </summary>
    public class ProductDetailResponse
    {

        public long Id { get; set; }

        /// <summary>
        /// 产品类型
        /// </summary>
        public long ProductTypeParentId { get; set; }

        /// <summary>
        /// 类别
        /// </summary>
        public long ProductTypeId { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 收益
        /// </summary>
        public decimal IncomeRate { get; set; }

        /// <summary>
        /// 总份额
        /// </summary>
        public decimal TotalShares { get; set; }

        /// <summary>
        /// 剩余份额
        /// </summary>
        public decimal RemainingShares { get; set; }

        /// <summary>
        /// 起购金额
        /// </summary>
        public decimal StartBuyPrice { get; set; }

        /// <summary>
        /// 倍数金额
        /// </summary>
        public decimal MultiplePrice { get; set; }

        /// <summary>
        /// 购买上限
        /// </summary>
        public decimal MaxBuyPrice { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string StartTimeText
        {
            get { return StartTime.ToString("yyyy-MM-dd HH:mm:ss"); }
        }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string EndTimeText
        {
            get { return EndTime.ToString("yyyy-MM-dd HH:mm:ss"); }
        }

        /// <summary>
        /// 产品期限
        /// </summary>
        public string TimeLimit { get; set; }

        /// <summary>
        /// 天数
        /// </summary>
        public int InvestmentTime { get; set; }

        /// <summary>
        /// 收益方式
        /// </summary>
        public int IncomeMethod { get; set; }

        /// <summary>
        /// 收益方式描述
        /// </summary>
        public string IncomeDescript { get; set; }

        /// <summary>
        /// 是否使用加息劵
        /// </summary>
        public int IsPlusInCome { get; set; }

        /// <summary>
        /// 是否可以使用现金劵
        /// </summary>
        public int IsCash { get; set; }

        /// <summary>
        /// 购买人次
        /// </summary>
        public int BuyCount { get; set; }

        /// <summary>
        /// 购买人次
        /// </summary>
        public string BuyCountText
        {
            get
            {
                try
                {
                    if (BuyCount > 100000000)
                    {
                        return Math.Round((decimal)BuyCount / 100000000, 2) + "亿笔";
                    }
                    else
                    if (BuyCount > 10000)
                    {
                        return Math.Round((decimal)BuyCount / 10000, 2) + "万笔";
                    }
                    else if (BuyCount <= 0)
                    {
                        return "0笔";
                    }
                    return BuyCount.ToString("##,###") + "笔";
                }
                catch
                {
                    return "0笔";
                }
            }
        }

        /// <summary>
        /// 项目描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 项目描述和资金保障
        /// </summary>
        public string Security { get; set; }

        /// <summary>
        /// 开始计息日期
        /// </summary>
        public string StartDrawDateText
        {
            get
            {
                return StartTime < DateTime.Now ? DateTime.Now.ToString("yyyy-MM-dd") : StartTime.ToString("yyyy-MM-dd");
            }
        }

        /// <summary>
        /// 到期日期
        /// </summary>
        public string DueDateText
        {
            get
            {
                if (IncomeMethod == 3)
                {
                    return StartTime < DateTime.Now ? DateTime.Now.AddDays(InvestmentTime).ToString("yyyy-MM-dd") : StartTime.AddDays(InvestmentTime).ToString("yyyy-MM-dd");
                }
                return EndTime.ToString("yyyy-MM-dd");
            }
        }

        /// <summary>
        /// 使用有可用卡券
        /// </summary>
        public bool HasCoupon { get; set; }

        /// <summary>
        /// 新手专享不可购买文本
        /// </summary>
        public string NotBuyText { get; set; }

        /// <summary>
        /// 是否购买过该产品
        /// </summary>
        public int IsBuy { get; set; }

        /// <summary>
        /// 有效天数
        /// </summary>
        public string ValidDaysTip { get; set; }

        /// <summary>
        /// 产品倒计时
        /// </summary>
        public int CountDown { get; set; }

        /// <summary>
        /// 剩余天数
        /// </summary>
        public int RemainDays { set; get; }

        /// <summary>
        /// 是否复投
        /// </summary>
        public int IsRecast { set; get; }

        /// <summary>
        /// 复投率
        /// </summary>
        public decimal RecastIncomeRate { set; get; }

        /// <summary>
        /// 复投率
        /// </summary>
        public string RecastIncomeRateStr { set; get; }

        /// <summary>
        /// 复投提示描述(弹框中的提示)
        /// </summary>
        public string RecastDescTip { set; get; }

        //开启复投可以获得更多收益
        public string RecastDescStep1 { set; get; }

        //复投加息 2.00%
        public string RecastDescStep2 { set; get; }
    }
}